from models import *

def get_topic_by_seq(seq):
    topic_id = int(seq)
    topic= Topic.get_by_key_name("t_%s"%topic_id)
    return topic

def get_post(topic_id,seq_in_topic):
    seq=int(topic_id)
    seq_in_topic=int(seq_in_topic)
    post= Post.get_by_key_name("t_%d_p_%d"%(seq,seq_in_topic))
    return post